//
//  MHVideoEditViewModel.m
//  MiaoCircle
//
//  Created by 许正荣 on 2018/6/19.
//  Copyright © 2018年 acgera. All rights reserved.
//

#import "MHVideoEditViewModel.h"
#import "MHComposeViewModel.h"
//#import <TXUGCPublishTypeDef.h>

@implementation MHVideoEditViewModel


- (instancetype)initWithServices:(id<MHViewModelServices>)services params:(NSDictionary *)params{
    if (self = [super initWithServices:services params:params]) {
        self.videoPath = params[MHViewModelUtilKey];
        self.videoAsset = params[@"videoAsset"];
        self.musicPath = params[@"MHMusicPath"];
    }
    return self;
}

-(void)initialize
{
    [super initialize];
    @weakify(self);
    self.publishVideo = [[RACCommand alloc] initWithSignalBlock:^RACSignal *(TXPublishResult *result) {
        @strongify(self);
        
        MHComposeViewModel *viewModel = [[MHComposeViewModel alloc] initWithServices:self.services
                                                                              params:@{MHViewModelUtilKey:[AXAppDelegate sharedDelegate].currentCircleInfo,@"MHCirclComposeType":@(MHCirclComposeTypeVideo),
                                                                                       @"MHComposePublishResult":result
                                                                                       }];
        [self.services presentViewModel:viewModel animated:YES completion:nil];
        return [RACSignal empty];

        

    }];
}
@end
